package doublelistdemo;

import java.util.LinkedList;

/**
 * @Author 12629
 * @Date 2022/3/15 21:25
 * @Description：
 */
public class TestDemo {


    public static void main(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.addLast(2);
        myLinkedList.addLast(1);
        myLinkedList.addLast(1);
        myLinkedList.display();
        System.out.println("删除所有的1：");
        myLinkedList.removeAllKey(1);
        myLinkedList.display();

        LinkedList<Integer> linkedList = new LinkedList<>();
        linkedList.add(1);
        linkedList.add(2);
        linkedList.add(3);
        linkedList.add(4);
        System.out.println(linkedList);
    }

    public static void main1(String[] args) {
        MyLinkedList myLinkedList = new MyLinkedList();
        myLinkedList.addLast(1);
        myLinkedList.addLast(2);
        myLinkedList.addLast(3);
        myLinkedList.display();

        myLinkedList.addIndex(2,19);
        myLinkedList.display();
    }
}
